package work.gac.unbind.v2;

import core.encoder.lianwei.PIIDataAESEncoder;
import core.util.ConcurrentUtil;
import core.util.TransformCsvData;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Gong.Yang
 */
@Slf4j
public class Main {

    static UnkinderManager manager = new UnkinderManager();


    public static void main(String[] args) {
        List<String[]> data = new ArrayList<>();
        TransformCsvData.peekCsv(Setting.Fix.filePath + ".csv", 0, data::add);

        List<Runnable> tasks = new ArrayList<>();

        for (String[] item : data) {
            if (item.length < 3) {
                log.info("【遍历数据】长度不够,item:{}", List.of(item));
                continue;
            }
            tasks.addAll(manager.unbindTask(item[0], item[1], item[2]));
        }

        ConcurrentUtil.commit(tasks, 32, 1);
    }
}
